import 'package:json_annotation/json_annotation.dart';

part 'personalGroups.g.dart';

@JsonSerializable(explicitToJson: true)
class PersonalGroups {
  List<PersonalGroup> personalGroups;

  PersonalGroups(this.personalGroups);

  factory PersonalGroups.fromJson(Map<String, dynamic> json) =>
      _$PersonalGroupsFromJson(json);

  Map<String, dynamic> toJson() => _$PersonalGroupsToJson(this);
}

@JsonSerializable(explicitToJson: true)
class PersonalGroup {
  int group_id;
  int user_id;
  String group_name;
  String last_message_state;
  String last_message;

  PersonalGroup(this.group_id, this.user_id, this.group_name, this.last_message,
      this.last_message_state);

  factory PersonalGroup.fromJson(Map<String, dynamic> json) =>
      _$PersonalGroupFromJson(json);

  Map<String, dynamic> toJson() => _$PersonalGroupToJson(this);
}
